
/*!
 * 
 * dialog javascript
 * 
 */
$(function() {
		// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
		$( "#dialog:ui-dialog" ).dialog( "destroy" );
		
		$( "#resEditDialog-form" ).dialog({
			autoOpen: false,
			height: 300,
			width: 440,
			modal: true,
			buttons: {
				"是的": function() {
					alert("设置成功！");
					$("#editForm").submit();
					$( this ).dialog( "close" );
					return false;
				},
				"算了": function() {
					$( this ).dialog( "close" );
					return false;
				}
			},
			close: function() {
			}
		});
		
		$( ".resEditDialog" ).click(function() {
			$( "#resEditDialog-form" ).dialog( "open" );
			
			$("#res_id").val($(this).attr("value"));
			var objs = $(this).parent().parent().children("td");
			$("#res_name").val(objs[0].innerHTML);
			$("#res_url").val(objs[1].innerHTML);
			$("#res_description").val(objs[2].innerHTML);
		});
});